<?php
/*
Plugin Name: RecentComments
Plugin URI: http://www.yhustc.com/
Description: 最新评论
Author: yhustc
Version: 1.0
Author URI: http://www.yhustc.com/
*/

class RecentCommentsWidget extends Widget
{
	function render($data=array())
	{
		$commentList = S("commentList");
		if(!$commentList)
		{
			$Dao = D("Comments");
			$commentList = $Dao->where("comment_type='comment' AND comment_approved='1'")->order("comment_date DESC")->top5();
			S("commentList",$commentList);
		}
		
		$this->assign("commentList",$commentList);
		return $this->renderFile();
	}
}
?>